package com.jt.www.domain.enums.common;

/**
 * 状态,1-启用中  0-已停用
 */
public enum IndustryStatusEnum {

    ENABLED((byte) 1, "启用中"),
    DISABLED((byte) 0, "已停用");

    /**
     * code
     */
    private Byte status;
    /**
     * 描述
     */
    private String desc;

    IndustryStatusEnum(Byte status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public static String getDescByValue(Byte status) {
        if (null == status) {
            return "";
        }
        for (IndustryStatusEnum industryStatusEnum : IndustryStatusEnum.values()) {
            if (industryStatusEnum.status == status) {
                return industryStatusEnum.desc;
            }
        }
        return "";
    }

    public static IndustryStatusEnum getEnumByValue(Byte status) {
        for (IndustryStatusEnum industryStatusEnum : IndustryStatusEnum.values()) {
            if (industryStatusEnum.status == status) {
                return industryStatusEnum;
            }
        }
        return null;
    }


    public Byte getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }
}


